package com.example.stock.service;

import com.example.stock.comm.StrategyEnum;
import com.example.stock.vo.DataVo;
import com.example.stock.vo.common.TradeVo;

import java.util.List;
import java.util.Map;

/**
 * closeData为收盘价
 */
public interface IServiceCalc {

    Map<String, List<TradeVo>> doMultiCalc(Map<String, List<DataVo>> closeDataMap, int m, int n, StrategyEnum strategy);

    List<TradeVo> doCalcOne( List<DataVo> closeDataMap, int m, int n, StrategyEnum strategy);


    /**
     * 根据 ma线的上扬和下扬 为买卖依据
     */
    List<TradeVo> calcMaUpTrade(List<DataVo> closeData, int m, int n);

    /**
     * 根据ema 的上扬为买卖依据
     * JJ:=EMA((CLOSE-MA(CLOSE,M))*1000/MA(CLOSE,M),N),LINETHICK2,COLOR0000FF;
     * 散:=JJ-REF(JJ,1);
     */
    List<TradeVo> calcEmaUpTrade(List<DataVo> closeData, int m, int n);

    //JJ:=EMA((CLOSE-MA(CLOSE,M))*1000/MA(CLOSE,M),N),LINETHICK2,COLOR0000FF;
    //散:=JJ-REF(JJ,1);
    //单计算结果 jj> ref时  ,,,,, 则股票买卖逻辑参考ma线
    List<TradeVo> calcEmaUpTradeComplex(List<DataVo> closeData, int m, int n, int ref, int ma);

    //散户指标://JJ:=EMA((CLOSE-MA(CLOSE,M))*1000/MA(CLOSE,M),N),LINETHICK2,COLOR0000FF;
    List<TradeVo> calcEmaRef0Trade(List<DataVo> closeData, int m, int n);

    //双ma线 交叉为买卖依据
    List<TradeVo> calcMaCrossTrade(List<DataVo> closeData, int m, int n);

    //通过判断股价是否站上均线
    List<TradeVo> calcMaPureTrade(List<DataVo> closeData, int m);

    List<TradeVo> calcEMaPureTrade(List<DataVo> closeData, int m);

}
